package com.xzy.b;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 基于BeanPostProcessor实现@Value的功能
 *
 * @author xzy
 * @date 2021/12/314:31
 */
public class Main {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();

        // 注册后置处理器、其他Bean
        applicationContext.register(MyBeanPostProcessor.class);
        applicationContext.register(UserComponent.class);
        applicationContext.refresh();

        System.out.println(applicationContext.getBean(UserComponent.class));
    }
}
